﻿using System;
using System.Collections.Generic;
using Nop.Core.Domain.Localization;
using Nop.Core.Domain.Catalog;

namespace Nop.Core.Domain.Stores
{
    /// <summary>
    /// Represents a store
    /// </summary>
    public partial class Store : BaseEntity, ILocalizedEntity
    {
        private ICollection<Branch> _branches;

        public const int AllStoreReservedId = 1;

        /// <summary>
        /// Gets or sets the name
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// Gets or sets the description
        /// </summary>
        public string Description { get; set; }

        /// <summary>
        /// Gets or sets a value of used store template identifier
        /// </summary>
        public int StoreTemplateId { get; set; }

        /// <summary>
        /// Gets or sets the meta keywords
        /// </summary>
        public string MetaKeywords { get; set; }

        /// <summary>
        /// Gets or sets the meta description
        /// </summary>
        public string MetaDescription { get; set; }

        /// <summary>
        /// Gets or sets the meta title
        /// </summary>
        public string MetaTitle { get; set; }

        /// <summary>
        /// Gets or sets the search-engine name
        /// </summary>
        public string SeName { get; set; }

        /// <summary>
        /// Gets or sets the parent picture identifier
        /// </summary>
        public int PictureId { get; set; }

        /// <summary>
        /// Gets or sets the page size
        /// </summary>
        public int PageSize { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether customers can select the page size
        /// </summary>
        public bool AllowCustomersToSelectPageSize { get; set; }

        /// <summary>
        /// Gets or sets the available customer selectable page size options
        /// </summary>
        public string PageSizeOptions { get; set; }

        /// <summary>
        /// Gets or sets the available price ranges
        /// </summary>
        public string PriceRanges { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether the entity is published
        /// </summary>
        public bool Published { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether the entity is featured on SH main page
        /// </summary>
        public bool Featured { get; set; }
        /// <summary>
        /// Gets or sets a value indicating whether the entity has been deleted
        /// </summary>
        public bool Deleted { get; set; }

        /// <summary>
        /// Gets or sets the display order
        /// </summary>
        public int DisplayOrder { get; set; }

        /// <summary>
        /// Gets or sets the date and time of instance creation
        /// </summary>
        public DateTime CreatedOnUtc { get; set; }

        /// <summary>
        /// Gets or sets the date and time of instance update
        /// </summary>
        public DateTime UpdatedOnUtc { get; set; }

        /// <summary>
        /// Gets or sets the Minimal Order subtotal amount
        /// </summary>
        public decimal MinOrderSubtotalAmount { get; set; }

        /// <summary>
        /// Gets or sets the Minimal Order total amount
        /// </summary>
        public decimal MinOrderTotalAmount { get; set; }
        
        /// <summary>
        /// Gets or sets the rating sum (approved reviews)
        /// </summary>
        public int ApprovedRatingSum { get; set; }

        /// <summary>
        /// Gets or sets the rating sum (not approved reviews)
        /// </summary>
        public int NotApprovedRatingSum { get; set; }

        /// <summary>
        /// Gets or sets the total rating votes (approved reviews)
        /// </summary>
        public int ApprovedTotalReviews { get; set; }

        /// <summary>
        /// Gets or sets the total rating votes (not approved reviews)
        /// </summary>
        public int NotApprovedTotalReviews { get; set; }
        
        /// <summary>
        /// Gets or sets the banner identifier
        /// </summary>
        public int BannerId { get; set; }

        /// <summary>
        /// Gets or sets the billing customer identifier
        /// </summary>
        public int BillToCustomerId { get; set; }

        /// <summary>
        /// Gets or sets the admin customer identifier
        /// </summary>
        public int? AdminCustomerId { get; set; }

        /// <summary>
        /// Gets or sets the main branch identifier
        /// </summary>
        public int? MainBranchId { get; set; }

        /// <summary>
        /// Gets or sets the tax code. e.g. GST#
        /// </summary>
        public string TaxCode { get; set; }

        /// <summary>
        /// Gets or sets the storage amount
        /// </summary>
        public decimal StorageAmount { get; set; }

        /// <summary>
        /// Gets or sets the strage rate per store
        /// </summary>
        public decimal? StorageChargeRate { get; set; }

        /// <summary>
        /// Gets or sets the monthly charge
        /// </summary>
        public decimal MonthlyCharge { get; set; }

        /// <summary>
        /// Gets or sets the service charge rate
        /// </summary>
        public decimal ServiceChargeRate { get; set; }

        /// <summary>
        /// Gets or sets the transaction processing charge rate per store
        /// </summary>
        public decimal? TransactionProcessingChargeRate { get; set; }

        /// <summary>
        /// region id
        /// </summary>
        public int RegionId { get; set; }

        /// <summary>
        /// Gets or sets store branches
        /// </summary>
        public virtual ICollection<Branch> Branches
        {
            get { return _branches ?? (_branches = new List<Branch>()); }
            protected set { _branches = value; }
        }
    }
}
